<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <link rel="icon" href="./images/Logo.jpg" type="image/x-icon">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>茗旅定制 - 专属茶文化之旅</title>
    <style>
        :root {
            --primary-color: #2d5a27;
            --secondary-color: #8ba888;
            --accent-color: #e8b059;
        }

        body {
            font-family: 'Arial', '微软雅黑', sans-serif;
            background: url('./特色服务背景.jpg') no-repeat center center fixed;
            background-size: cover;
            line-height: 1.8;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            padding: 20px;
        }

        .container {
            background: rgba(255,255,255,0.95);
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 680px;
            padding: 40px;
            position: relative;
            overflow: hidden;
        }

        .container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 8px;
            background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
        }

        h2 {
            color: var(--primary-color);
            text-align: center;
            margin-bottom: 30px;
            font-size: 2.2em;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        h2::before {
            content: '🍵';
            font-size: 1.2em;
        }

        .form-group {
            margin-bottom: 25px;
            position: relative;
        }

        label {
            display: block;
            margin-bottom: 12px;
            color: #495057;
            font-weight: 500;
            font-size: 0.95em;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .radio-group {
            display: flex;
            gap: 25px;
            flex-wrap: wrap;
        }

        .radio-group label {
            position: relative;
            padding-left: 28px;
            cursor: pointer;
        }

        .radio-group input[type="radio"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .radio-custom {
            position: absolute;
            left: 0;
            top: 2px;
            width: 18px;
            height: 18px;
            border: 2px solid var(--secondary-color);
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .radio-group input:checked ~ .radio-custom {
            border-color: var(--primary-color);
            background: radial-gradient(circle, var(--primary-color) 40%, transparent 45%);
        }

        .checkbox-group {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 15px;
        }

        .checkbox-item {
            position: relative;
            background: #f8f9fa;
            border-radius: 8px;
            padding: 12px;
            transition: all 0.3s ease;
        }

        .checkbox-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 3px 10px rgba(0,0,0,0.05);
        }

        .checkbox-item input:checked + span {
            color: var(--primary-color);
            font-weight: 600;
        }

        input[type="text"],
        input[type="number"],
        input[type="email"] {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #e9ecef;
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s ease;
        }

        input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
            outline: none;
        }

        .verify-code {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 15px;
        }

        #sendCode {
            background: var(--primary-color);
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        #sendCode:hover {
            background: #23421e;
            transform: translateY(-1px);
        }

        #sendCode:disabled {
            background: #a0a0a0;
            cursor: not-allowed;
        }

        button[type="submit"] {
            width: 100%;
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
            color: white;
            padding: 16px;
            border: none;
            border-radius: 8px;
            font-size: 1.1em;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 20px;
        }

        button[type="submit"]:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(45, 90, 39, 0.2);
        }

        /* 定制弹窗 */
        .custom-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.4);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .modal-content {
            background:white;
            padding: 40px;
            border-radius: 20px;
            text-align: center;
            max-width: 400px;
            transform: translateY(-50px);
            opacity: 0;
            animation: modalShow 0.3s ease forwards;
        }

        @keyframes modalShow {
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        @media (max-width: 576px) {
            .container {
                padding: 25px;
            }
            
            .verify-code {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>特色服务——定制您的茶文化之旅</h2>
        <form id="travelForm">
            <!-- 身份选择 -->
            <div class="form-group">
                <label>📌 您的身份</label>
                <div class="radio-group">
                    <label>
                        <input type="radio" name="identity" value="大学生" required>
                        <span class="radio-custom"></span>
                        大学生
                    </label>
                    <label>
                        <input type="radio" name="identity" value="家长">
                        <span class="radio-custom"></span>
                        家长
                    </label>
                    <label>
                        <input type="radio" name="identity" value="其他">
                        <span class="radio-custom"></span>
                        其他
                    </label>
                </div>
            </div>

            <!-- 茶区选择 -->
            <div class="form-group">
                <label>🍃 感兴趣的茶区</label>
                <div class="checkbox-group">
                    <label class="checkbox-item">
                        <input type="checkbox" value="红茶">
                        <span>红茶</span>
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" value="绿茶">
                        <span>绿茶</span>
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" value="青茶">
                        <span>青茶</span>
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" value="黄茶">
                        <span>黄茶</span>
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" value="黑茶">
                        <span>黑茶</span>
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" value="白茶">
                        <span>白茶</span>
                    </label>
                </div>
            </div>

            <!-- 预算和时长 -->
            <div class="form-group">
                <label>💰 预算（元）</label>
                <input type="number" id="budget" required min="0">
            </div>

            <div class="form-group">
                <label>⏳ 旅行时长（天）</label>
                <input type="number" id="duration" required min="1">
            </div>

            <!-- 邮箱验证 -->
            <div class="form-group">
                <label>📧 电子邮箱</label>
                <input type="email" id="email" required>
            </div>

            <div class="form-group">
                <label>🔐 验证码</label>
                <div class="verify-code">
                    <input type="text" id="codeInput" placeholder="请输入6位验证码" required>
                    <button type="button" id="sendCode" onclick="sendVerificationCode()">获取验证码</button>
                </div>
            </div>

            <button type="submit">立即定制旅程 ✈️</button>
        </form>
    </div>

    <!-- 定制弹窗 -->
    <div class="custom-modal" id="successModal">
        <div class="modal-content">
            <h3>🎉 提交成功！</h3>
            <p>您的定制旅行计划将在24小时内发送至邮箱</p>
            <button onclick="closeModal()" style="margin-top: 20px;">确认</button>
        </div>
    </div>

    <script>
        // 发送验证码功能
        function sendVerificationCode() {
            const email = document.getElementById('email').value;
            const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

            if (!emailRegex.test(email)) {
                showError('请输入有效的邮箱地址');
                return;
            }

            const button = document.getElementById('sendCode');
            button.disabled = true;
            let countdown = 60;

            // 模拟发送验证码
            console.log(`验证码发送至 ${email}（演示用）: 123456`);

            const timer = setInterval(() => {
                button.textContent = `${countdown}s后重发`;
                countdown--;

                if (countdown < 0) {
                    clearInterval(timer);
                    button.disabled = false;
                    button.textContent = '获取验证码';
                }
            }, 1000);
        }

        // 表单提交处理
        document.getElementById('travelForm').addEventListener('submit', function(e) {
            e.preventDefault();

            // 表单验证
            if (!validateForm()) return;

            // 显示成功弹窗
            document.getElementById('successModal').style.display = 'flex';
            this.reset();
        });

        function validateForm() {
            const code = document.getElementById('codeInput').value;
            if (code !== '123456') { // 演示固定验证码
                showError('验证码不正确');
                return false;
            }
            return true;
        }

        function showError(message) {
            const errorDiv = document.createElement('div');
            errorDiv.className = 'error-message';
            errorDiv.textContent = message;
            errorDiv.style.color = '#dc3545';
            errorDiv.style.marginTop = '10px';
            document.getElementById('travelForm').appendChild(errorDiv);
            setTimeout(() => errorDiv.remove(), 3000);
        }

        function closeModal() {
            document.getElementById('successModal').style.display = 'none';
        }

        // 输入即时验证
        document.getElementById('email').addEventListener('blur', function() {
            const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            if (!emailRegex.test(this.value)) {
                this.style.borderColor = '#dc3545';
            } else {
                this.style.borderColor = '#e9ecef';
            }
        });
    </script>
</body>
</html>